{% extends "base.html" %}

{% block title %}
    系统设置
{% endblock %}

{% block page_title %}
    管理员 - 编辑
{% endblock %}

{% block body %}
    <div class="form-container">
        <form id="updateForm" class="edit-form" method="post" action="{{ url_for('system_admin.edit',id=id) }}">
            {{ form.csrf_token }}
            <div class="form-section">
                <div class="form-grid">
                    {% for field in form %}
                        {% if field.type == "CSRFTokenField" %}
                            {{ "" }}
                        {% else %}
                            <div class="form-group">
                                {{ field.label(class="form-label") }} {% if field.flags.required %}
                                <span class="required">*</span>{% endif %}
                                {{ field(class="form-input") }}
                                <div class="form-error">
                                    {% for error in field.errors %}{{ error }}{% endfor %}</div>
                            </div>
                        {% endif %}
                    {% endfor %}
                </div>
            </div>
            <div class="form-section">
                <div class="form-actions">
                    <button type="submit" form="updateForm" class="btn btn-primary">
                        <i class="fa fa-paper-plane"></i> 提交
                    </button>
                    <button type="button" id="cancelBtn" class="btn btn-cancel"
                            onclick="window.location.href='{{ url_for('system_admin.page') }}'">
                        <i class="fa fa-reply"></i> 返回
                    </button>
                </div>
            </div>
        </form>
    </div>
{% endblock %}